package odmd.handler;

import java.util.concurrent.ThreadFactory;

/**
 * 
 * @author <a mailto="hwangsyin@gmail.com">King</a>
 *
 */
public final class SocketChannelHandlerThreadFactory implements ThreadFactory {
	private static int count = 0;
	
	public Thread newThread(Runnable r) {
		Thread t = new Thread(r);
		t.setPriority(Thread.MIN_PRIORITY);
		
		synchronized(SocketChannelHandlerThreadFactory.class) {
			t.setName("SocketChannelHandlerThread-" + (count++));
		}
		
		return t;
	}

}
